/**
 * Created by Administrator on 2017/2/15.
 */
public class Main01 {
    static int count[] = new int[256];
    //Insert one char from stringstream
    static int index = 1;


    public static void insert(char ch)


    {
        if (count[ch] == 0) {
            count[ch] = index++;
        } else {
            count[ch] = -1;
        }
    }
//return the first appearence once char in current stringstream


    public static char firstAppearingOnce() {
        int temp = Integer.MAX_VALUE;
        char ch = '#';
        for (int i = 0; i < 256; i++) {
            if (count[i] != 0 && count[i] != -1 && count[i] < temp) {
                temp = count[i];
                ch = (char) i;
            }
        }
        return ch;
    }

    public static void main(String[] args) {
        char[] chs = "google".toCharArray();
        for (int i = 0; i < chs.length; i++) {
            insert(chs[i]);
        }
        System.out.println(firstAppearingOnce());
    }
}
